import java.util.Scanner;//类似include--自动导入

public class Main {
    public static void main(String[] args) {
        //循环输入
        Scanner scan = new Scanner(System.in);
        /*while(scan.hasNextInt()){//ctrl + d 结束输入
            System.out.println("请输入你的年龄");
            int age = scan.nextInt();
            System.out.println("年龄:"+age);
        }*/
        //循环输入字符串
        while(scan.hasNextLine()){
            System.out.println("请输入姓名：");
            String line = scan.nextLine();
            System.out.println("姓名："+line);
        }
        //cmd里结束 是 ctrl + z
    }
    public static void main9(String[] args) {
        Scanner scan = new Scanner(System.in);
        int age = scan.nextInt();
        scan.nextLine();
        String name = scan.nextLine();
        System.out.println(age + " " + name);

    }
    //输出
    public static void main8(String[] args) {
        int a = 1;
        System.out.println(a);
        System.out.print(a);
        System.out.printf("\n");
        System.out.printf("%d ",a);
    }
    public static void main7(String[] args) {
        //找到1-100之间及能够被3整除，也能被5整除的数字
        int i =1;
        for(i=1;i<=100;i++){
            if(i%3 != 0) {
                continue;
            }
            else if(i%5 != 0){
                continue;
            }
            System.out.println(i);
        }
    }
    public static void main6(String[] args) {
        int i = 1;
        int ret = 1,sum = 0;
        while(i<=5){
            ret*=i;
            i++;
            sum += ret;
        }
        System.out.println(ret);
        System.out.println(sum);
    }
    public static void main5(String[] args) {
        //计算1-100偶数的和
        //计算1-100奇数的和
        int i=1;
        int sum1=0,sum2 =0;
        for(i=1;i<=100;i++)
        {
            if(i%2 == 0)
                sum1 +=i;
            else
                sum2 +=i;
        }
        System.out.println(sum1);
        System.out.println(sum2);
    }
    public static void main4(String[] args) {
        //while
        int i =1;
        int sum = 0;
        for(i=1;i<=10;i++){
            sum+=i;
        }
        System.out.println(sum);
       /* while(i >= 0){
            System.out.println(i);
            i--;
        }*/
    }
//命名规则《head first java》
    public static void main3(String[] args) {
        //switch
        short a = 1;
        long b = 100;//long 类型不能作为switch参数
        String s = "Hello";
        switch(s){
            case "1":
                System.out.println("one");
                break;
            case "Hello":
                System.out.println("Hello");
                break;
            default:
                System.out.println("default");
                break;
        }
    }
    public static void main2(String[] args) {
        //判断闰年
        Scanner sc = new Scanner(System.in);
        int year = sc.nextInt();
        if(year % 4  == 0 && year % 100 != 0)
            System.out.println("aaa");
        else if (year % 400 == 0){
            System.out.println("bbb");
        }
    }
    public static void main1(String[] args) {
        //Scanner 工具  System.in ：键盘
        Scanner scanner = new Scanner(System.in);
        //int a = 2;
        int a = scanner.nextInt();//输入类型有区分
        if(a == 1)
            System.out.println("a = 1");
        else
            System.out.println("a != 1");
        double d = scanner.nextDouble();
        if(d == 3)
           System.out.println(d);
    }
}